<template>
  <div class="transition-container">
    <div class="transition-boxes">
      <div class="box" @click="goToFood">
        <h1>膳食系统</h1>

        <p class="texttt">点击进入膳食管理页面</p>
      </div>
      <div class="box" @click="goToMaintenance">
        <h1>维修系统</h1>
        <p class="texttt">点击进入维修保修页面</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goToFood() {
      // 跳转到膳食页面
      this.$router.push('/food');
    },
    goToMaintenance() {

      // 跳转到维修页面
      const roleId = localStorage.getItem("roleId");
      if (roleId === "1" || roleId === "4") {
        // 跳转到页面1或页面4
        this.$router.push('/repair-list-user');
      }
    }
  }
};
</script>

<style scoped>
.transition-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /*background: linear-gradient(135deg, #4a90e2, #9013fe);*/
  background-image: url("@/assets/img/Jump.jpg");
  display: flex;
  justify-content: center;
  align-items: center;
}

.transition-boxes {
  display: flex;
  justify-content: space-between;
  width: 60%;
  height: 30%;
}

.box {
  width: 45%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);

  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.box:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.box h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}

.texttt {
  margin-top: 50px;
}

.box p {
  font-size: 16px;
  color: #555;
}
</style>
